/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package aliasMatching.controller;

import aliasMatching.model.Alias;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;

/**
 *
 * @author amendrashrestha
 */
public class TimeClustering {

    public List<Alias> aliases;
    List userList;

    public TimeClustering(List users) throws SQLException {
        aliases = new ArrayList<Alias>();
        userList = users;
        Alias[] tempAlias = new Alias[userList.size()];

        for (int i = 0; i < userList.size(); i++) {
            String userID = userList.get(i).toString();
            tempAlias[i] = new Alias(userID);

            int tempUserID = Integer.parseInt(userID);
            List postTimes = Alias.getAllPostTime(tempUserID);
            tempAlias[i].setPostTime(postTimes);
            //tempAlias[i].setTimeStamp(rr);
            aliases.add(tempAlias[i]);
        }
    }
}
